from django.db import models

# Create your models here.
from django.contrib.auth.models import AbstractUser

# 自定义数据模型--继承与框架原本的用户模型
class User(AbstractUser):
    # mobile = models.CharField("电话", max_length=11, unique=True)
    # address = models.CharField(max_length=350,blank=True,null=True) # 由于用户可能有多个收货地址所以就不一对一了。
    email = models.EmailField("邮箱", blank=True, null=True)
    sex = models.BooleanField("性别", default=True, blank=True, null=True)
    age = models.IntegerField("年龄", default=18, blank=True, null=True)

    class Meta:
        db_table = "cassoapi_users"
        verbose_name = "用户表"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.username